home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-06 | 2.3 KB | 84 lines | [TEXT/MPS ] |
- {This include file contains the action procedures for}
- {each of the different kinds of drags you can do from}
- {one list to another or from a list to itself}
-
-
-
- PROCEDURE SetSourceDestLists (ClickPt : Point);
- BEGIN
- IF PtInRect(AnchorPoint, gList1^^.RView) THEN
- BEGIN
- gSourceList := gList1;
- gDestLists[1] := gList2;
- gDestLists[2] := gList3;
- gNumDestLists := 2;
- gDragStyle := kDragToOtherList + kDragOutside;
- END
- ELSE
- IF PtInRect(ClickPt, gList2^^.RView) THEN
- BEGIN
- gSourceList := gList2;
- gDestLists[1] := gList3;
- gNumDestLists := 1;
- gDragStyle := kDragToOtherList +
- kDragToOwnList + kDragOutside;
- END
- ELSE
- IF PtInRect(ClickPt, gList3^^.RView) THEN
- BEGIN
- gSourceList := gList3;
- gDestLists[1] := gList1;
- gDestLists[2] := gList2;
- gNumDestLists := 2;
- gDragStyle := kDragToOtherList+kDragOutside;
- END;
- END;
-
- {-------------------------------------------------------------------------}
-
- PROCEDURE DragToDestAction (SourceList : ListHandle; SourceCell : Point;
- DestList : ListHandle; DestCell : Point);
- {insert data from SourceList into the DestList}
- VAR
- STemp : Str255;
- DLen : Integer;
- BEGIN
- DLen := SizeOF(STemp);
- LGetCell(@Stemp, DLen, SourceCell, SourceList);
- DestCell.v := LAddRow (1, DestCell.v, DestList);
- LSetCell (@Stemp, DLen, DestCell, DestList);
- END;
-
- {-------------------------------------------------------------------------}
-
- PROCEDURE DragToSourceAction (SourceList : ListHandle; SourceCell : Point;
- DestList : ListHandle; DestCell : Point);
- {swap the data in the Source and Dest cells}
- VAR
- STemp, DTemp : Str255;
- SLen, DLen : Integer;
- BEGIN
- DLen := SizeOF(STemp); SLen := SizeOF(STemp);
- LGetCell (@STemp, SLen, SourceCell, SourceList);
- LGetCell (@DTemp, DLen, DestCell, DestList);
- LSetCell (@STemp, SLen, DestCell, DestList);
- LSetCell (@DTemp, DLen, SourceCell, SourceList);
- END;
-
- {-------------------------------------------------------------------------}
-
- PROCEDURE BadDragAction (SourceList : ListHandle; SourceCell : Point);
- {do nothing}
- BEGIN
- Sysbeep(1);
- END;
-
- {-------------------------------------------------------------------------}
-
- PROCEDURE DragOutsideAction (SourceList : ListHandle; SourceCell : Point);
- {Delete the item at SourceCell in SourceList}
- BEGIN
- LDelRow (1, SourceCell.v, SourceList);
- END;
-
-